
package com.bk.service.impl;

import java.sql.SQLException;
import java.util.List;

import com.bk.dao.impl.CategoryDaoImpl;
import com.bk.model.Category;
import com.bk.service.CategoryService;

public class CategoryServiceImpl implements CategoryService{

	private CategoryDaoImpl categoryDaoImpl=new CategoryDaoImpl();
	@Override
	public List<Category> findAllCategory() throws SQLException{
		
		
		//TODO
		return categoryDaoImpl.findAll();
			
	}
	@Override
	public Category findByCid(String cid) throws SQLException{
		List<Category> list = categoryDaoImpl.findByOthers("select * from category where cid=?", cid);
		if(list.size()>0){
			return list.get(0);
		}
		return null;
			
	}

}

	